<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML>
<html>
	<head>
		<base href="<%=basePath%>">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		 <%--<link rel="stylesheet" type="text/css"
			href="<%=basePath%>jslib/bootstrap/css/bootstrap.css">
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>css/theme.css">
		  <link rel="stylesheet"
			href="<%=basePath%>jslib/font-awesome/css/font-awesome.css"> --%>
	    <link rel="stylesheet" href="homepage/css/font-awesome.min.css">
	    <link rel="stylesheet" href="homepage/css/bootstrap.min.css">
	    <link rel="stylesheet" href="homepage/css/index.css">
	    
	     <script src="<%=basePath%>jslib/jquery-1.7.2.min.js"
			type="text/javascript"></script>
	    <script src="homepage/js/jquery.min.js"></script>
	    <script src="homepage/js/bootstrap.min.js"></script>
	    <script src="homepage/js/index.js"></script>
	    
	    <title>主页</title>
	    
	    <script type="text/javascript">
		    function check(){
		    	var num1=document.getElementById("gnum").value;
		    	var num2=document.getElementById("cartnum").value;
		    	if(num2<=0||num1-num2<0){
		    		alert("输入的数字不合法");
		    		return false;
		    	}
		    	return true;
		    }
		</script>
		<style type="text/css">
		  .la{
		     width:100px;
		     text-align: right;
		  }
		</style>
</head>
<body>
<header id="header">
    <nav id="top-nav">
        <div class="city">
            太原&nbsp;&nbsp;<small>更换</small>
        </div>
        <div class="login">
            <ul>
				<c:if test="${sessionScope.user == null}">
					<li><a href="<%=basePath%>indexlogin">登录</a></li>
				</c:if>
				<c:if test="${sessionScope.user != null}">
					<li><a>欢迎&nbsp;&nbsp;<span style="color:red">${user.username}</span>&nbsp;,&nbsp;</a>
                   <a href="<%=basePath%>indexlogout">注销</a></li>
				</c:if>
                <li><a href="<%=basePath%>indexregist">注册</a></li>
                <li><a href="#">我的订单</a></li>
                <li><a href="javascript:void(0)">帮助中心</a></li>
                <li><a href="<%=basePath%>index">返回首页</a></li>
            </ul>
        </div>
    </nav>
    <div class="logo">
        <div class="content">
            <div class="left">
                <img src="homepage/img/logo.png" alt="logo" width="240px" height="90px"/>
            </div>
            <div class="right">
                <img src="homepage/img/ad.png" alt="广告" width="555px" height="89px"/>
            </div>
        </div>
    </div>
    <nav id="nav">
        <ul class="menu">
            <li class="active"><a href="<%=basePath%>index">电影首页</a></li>
            <li><a href="javascript:void(0)">电影排期</a></li>
            <li><a href="javascript:void(0)">移动购票</a></li>
            <li><a href="javascript:void(0)">电影谈资</a></li>
            <li class="special"><a href="javascript:void(0)"><i class="icon-bullhorn" style="font-size: 23px;color: #F9C221;"></i>&nbsp;&nbsp;活动促销</a></li>
        </ul>
    </nav>
    
</header>

<!--中间部分-->
<section id="main">
	<div class="crumbs">
			您当前的位置：<a class="aashy" href="<%=basePath%>index"
				style="display: inline">首页</a> &gt; <a class="aashy"
				href="javascript:void(0)" style="display: inline">正在热映</a>
			&gt; <a class="ablack" href="javascript:void(0)"
				style="display: inline; cursor: default;"
				title="${film.filmName } Doctor Strange">${film.filmName }->gid:${remain.gid}</a>
	</div>
   <div class="main-middel">
   	
   		<div >
			<div >
				<form method="post" action="<%=basePath%>film/order/createOrder">
					<div class="btn-toolbar">
						<input type="submit" class="btn btn-primary" onclick="return check()" value="购买 ">
					</div>
							<input type="hidden" name="filmId" value="${film.filmId}"/>
							<input type="hidden" name="userid" value="${user.userid}"/> 
							<input type="hidden" name="gid" value="${remain.gid}">
							<input type="hidden" name="screensid" value="${screensid}">
							<label class="la">
								影片名：
							</label>
							<input type="text"  name="filmName" value="${film.filmName}" readonly="readonly" maxlength="20">
                             <br>
							<label class="la">
								网购价：
							</label>
							<input type="text"  name="filmPrice" value="${film.filmPrice}" readonly="readonly" maxlength="20">
							<br>
							<label class="la">
								余票：
							</label>
								<input type="text" name="filmRemain" value="${remain.filmRemain}"  id="gnum"  readonly="readonly"    maxlength="20">
							<br>
							<label class="la">
								购买数量：
							</label>
								<input type="text" name="ordernum" id="cartnum"  placeholder="请添加购买数量。。。"   maxlength="20">
							<div style="color: red">
								${msg}
							</div>
						
				</form>
			</div>
		</div>
		
   </div>
</section>

<!--脚-->
<footer id="footer">
    <div class="other">
        <div class="other-content">
            <div class="other-left">
                <a href="#">联系我们</a>
                <a href="#">电影情报</a>
                <a href="#">友情链接</a>
            </div>
            <div class="other-right">
                <a href="#">万达集团</a>
                <a href="#">万达院线官网</a>
            </div>
        </div>
    </div>
    <div class="info">
        <p>Copyright © 2011-2013 Wandafilm.com ALL rights reserved&nbsp;&nbsp;&nbsp;&nbsp;冀ICP备13013593&nbsp;&nbsp;&nbsp;&nbsp;增值电信业务经营许可证B2-20130186 </p>
    </div>
</footer>
</body>
</html>